package tasks.OpportunitiesBaseData.MainView;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import tasks.Brand;

import core.Functions;
import core.testcases.TestProjectSuperHelper;

public class BrandLayout extends TestProjectSuperHelper {
	
	protected final String[] ESCAPE_CHARACTERS = {"$", ","};
	
	//Attributes for STG and ITS
	private String repInput;
	private String geo;
	private String imt;
	private String seller;
	private String owner;
	private String qtrInd;
	private String decWkorFcstWk;
	private String prodlvl30;
	private String oppNo;
	private String dtlKey;
	private String custName;
	private String custNo;
	private String ownOrg;
	private String oppSource;
	private String oppName;
	private String ssCode;
	private String ssName;
	private String dtlOdds;
	private String dtlRev;
	private String oppRole;
	private String siebelPVStatus;
	private String prismPVStatus;
	
	public String getRepInput() {
		return repInput;
	}
	
	public void setRepInput(String repInput) {
		this.repInput = (repInput != null)?escapeSpecChars(repInput.trim()):"";
	}
	
	public String getGeo() {
		return geo;
	}
	
	public void setGeo(String geo) {
		this.geo = (geo != null)?escapeSpecChars(geo.trim()):"";
	}
	
	public String getImt() {
		return imt;
	}
	
	public void setImt(String imt) {
		this.imt = (imt != null)?escapeSpecChars(imt.trim()):"";
	}
	
	public String getSeller() {
		return seller;
	}
	
	public void setSeller(String seller) {
		this.seller = (seller != null)?escapeSpecChars(seller.trim()):"";
	}

	public String getOwner() {
		return owner;
	}
	
	public void setOwner(String owner) {
		this.owner = (owner != null)?escapeSpecChars(owner.trim()):"";
	}
	
	public String getQtrInd() {
		return qtrInd;
	}
	
	public void setQtrInd(String qtrInd) {
		this.qtrInd = (qtrInd != null)?escapeSpecChars(qtrInd.trim()):"";
	}
	
	public String getDecWkorFcstWk() {
		return decWkorFcstWk;
	}
	
	public void setDecWkorFcstWk(String decWkorFcstWk) {
		this.decWkorFcstWk = (decWkorFcstWk != null)?escapeSpecChars(decWkorFcstWk.trim()):"";
	}

	public String getProdlvl30() {
		return prodlvl30;
	}
	
	public void setProdlvl30(String prodlvl30) {
		this.prodlvl30 = (prodlvl30 != null)?escapeSpecChars(prodlvl30.trim()):"";
	}
	
	public String getOppNo() {
		return oppNo;
	}
	
	public void setOppNo(String oppNo) {
		this.oppNo = (oppNo != null)?escapeSpecChars(oppNo.trim()):"";
	}
	
	public String getDtlKey() {
		return dtlKey;
	}
	
	public void setDtlKey(String dtlKey) {
		this.dtlKey = (dtlKey != null)?escapeSpecChars(dtlKey.trim()):"";
	}
	
	public String getCustName() {
		return custName;
	}
	
	public void setCustName(String custName) {
		this.custName = (custName != null)?escapeSpecChars(custName.trim()):"";
	}
	
	public String getCustNo() {
		return custNo;
	}
	
	public void setCustNo(String custNo) {
		this.custNo = (custNo != null)?escapeSpecChars(custNo.trim()):"";
	}
	
	public String getOwnOrg() {
		return ownOrg;
	}
	
	public void setOwnOrg(String ownOrg) {
		this.ownOrg = (ownOrg != null)?escapeSpecChars(ownOrg.trim()):"";
	}
	
	public String getOppSource() {
		return oppSource;
	}
	
	public void setOppSource(String oppSource) {
		this.oppSource = (oppSource != null)?escapeSpecChars(oppSource.trim()):"";
	}
	
	public String getOppName() {
		return oppName;
	}
	
	public void setOppName(String oppName) {
		this.oppName = (oppName != null)?escapeSpecChars(oppName.trim()):"";
	}
	
	public String getSsCode() {
		return ssCode;
	}
	
	public void setSsCode(String ssCode) {
		this.ssCode = (ssCode != null)?escapeSpecChars(ssCode.trim()):"";
	}
	
	public String getSsName() {
		return ssName;
	}
	
	public void setSsName(String ssName) {
		this.ssName = (ssName != null)?escapeSpecChars(ssName.trim()):"";
	}
	
	public String getDtlOdds() {
		return dtlOdds;
	}
	
	public void setDtlOdds(String dtlOdds) {
		this.dtlOdds = (dtlOdds != null)?escapeSpecChars(dtlOdds.trim()):"";
	}
	
	public String getDtlRev() {
		return dtlRev;
	}
	
	public void setDtlRev(String dtlRev) {
		this.dtlRev = (dtlRev != null)?escapeSpecChars(dtlRev.trim()):"";
	}
	
	public String getOppRole() {
		return oppRole;
	}
	
	public void setOppRole(String oppRole) {
		this.oppRole = (oppRole != null)?escapeSpecChars(oppRole.trim()):"";
	}
	
	public String getSiebelPVStatus() {
		return siebelPVStatus;
	}
	
	public void setSiebelPVStatus(String siebelPVStatus) {
		this.siebelPVStatus = (siebelPVStatus != null)?escapeSpecChars(siebelPVStatus.trim()):"";
	}
	
	public String getPrismPVStatus() {
		return prismPVStatus;
	}
	
	public void setPrismPVStatus(String prismPVStatus) {
		this.prismPVStatus = (prismPVStatus != null)?escapeSpecChars(prismPVStatus.trim()):"";
	}
	
	protected String escapeSpecChars(String value)
	{
		String result = "";
		
		if(value != null)
		{
			result = value;
			
			for(String escChar:ESCAPE_CHARACTERS)
			{
				result = result.replace(escChar, "");
			}
		}
		
		return result;
	}
	
	public boolean isEqual(BrandLayout layout)
	{
		boolean result = true;
		
		if(!this.getRepInput().equals(layout.getRepInput())) 
		{ 
			result = false;
			setComment("Difference in Rep Input  -   " + this.getRepInput() + " != " + layout.getRepInput()); 
		}
		
		if(!this.getGeo().equals(layout.getGeo())) 
		{ 
			result = false;
			setComment("Difference in Geo  -   " + this.getGeo() + " != " + layout.getGeo()); 
		}

		if(!this.getImt().equals(layout.getImt())) 
		{ 
			result = false;
			setComment("Difference in IMT  -   " + this.getImt() + " != " + layout.getImt()); 
		}
			
		if(!this.getSeller().equals(layout.getSeller())) 
		{ 
			result = false;
			setComment("Difference in Seller  -   " + this.getSeller() + " != " + layout.getSeller()); 
		}
			
		if(!this.getOwner().equals(layout.getOwner())) 
		{ 
			result = false;
			setComment("Difference in Owner  -   " + this.getOwner() + " != " + layout.getOwner()); 
		}
			
		if(!this.getQtrInd().equals(layout.getQtrInd())) 
		{ 
			result = false;
			setComment("Difference in Qtr Ind  -   " + this.getQtrInd() + " != " + layout.getQtrInd()); 
		}
			
		if(!this.getDecWkorFcstWk().equals(layout.getDecWkorFcstWk())) 
		{ 
			result = false;
			setComment("Difference in Dec Wk or Fcst Wk  -   " + this.getDecWkorFcstWk() + " != " + layout.getDecWkorFcstWk()); 
		}
			
		if(!this.getProdlvl30().equals(layout.getProdlvl30())) 
		{ 
			result = false;
			setComment("Difference in Prod Lvl 30  -   " + this.getProdlvl30() + " != " + layout.getProdlvl30()); 
		}
			
		if(!this.getOppNo().equals(layout.getOppNo())) 
		{ 
			result = false;
			setComment("Difference in Opp No  -   " + this.getOppNo() + " != " + layout.getOppNo()); 
		}
			
		if(!this.getDtlKey().equals(layout.getDtlKey())) 
		{ 
			result = false;
			setComment("Difference in Dtl Key  -   " + this.getDtlKey() + " != " + layout.getDtlKey()); 
		}
			
		if(!this.getCustName().equals(layout.getCustName())) 
		{ 
			result = false;
			setComment("Difference in Cust Name  -   " + this.getCustName() + " != " + layout.getCustName()); 
		}
			
		if(!this.getCustNo().equals( layout.getCustNo())) 
		{ 
			result = false;
			setComment("Difference in Cust No  -   " + this.getCustNo() + " != " + layout.getCustNo()); 
		}
			
		if(!this.getOwnOrg().equals(layout.getOwnOrg())) 
		{ 
			result = false;
			setComment("Difference in Own Org  -   " + this.getOwnOrg() + " != " + layout.getOwnOrg()); 
		}
			
		if(!this.getOppSource().equals(layout.getOppSource())) 
		{ 
			result = false;
			setComment("Difference in Opp Source  -   " + this.getOppSource() + " != " + layout.getOppSource()); 
		}
			
		if(!this.getOppName().equals(layout.getOppName())) 
		{ 
			result = false;
			setComment("Difference in Opp Name  -   " + this.getOppName() + " != " + layout.getOppName()); 
		}
			
		if(!this.getSsCode().equals(layout.getSsCode())) 
		{ 
			result = false;
			setComment("Difference in SS Code  -   " + this.getSsCode() + " != " + layout.getSsCode()); 
		}
			
		if(!this.getSsName().equals(layout.getSsName())) 
		{ 
			result = false;
			setComment("Difference in SS Name  -   " + this.getSsName() + " != " + layout.getSsName()); 
		}
			
		if(!this.getDtlOdds().equals(layout.getDtlOdds())) 
		{ 
			result = false;
			setComment("Difference in Dtl Odds  -   " + this.getDtlOdds() + " != " + layout.getDtlOdds()); 
		}
			
		if(!this.getDtlRev().equals(layout.getDtlRev())) 
		{ 
			result = false;
			setComment("Difference in Dtl Rev  -   " + this.getDtlRev() + " != " + layout.getDtlRev()); 
		}

		if (!this.getOppRole().equals(layout.getOppRole())) 
		{
			result = false;
			setComment("Difference in Opp Role  -   " + this.getOppRole() + " != " + layout.getOppRole());
		}

		if (!this.getSiebelPVStatus().equals(layout.getSiebelPVStatus())) 
		{
			result = false;
			setComment("Difference in Siebel PV Status  -   " + this.getSiebelPVStatus() + " != " + layout.getSiebelPVStatus());
		}

		if (!this.getPrismPVStatus().equals(layout.getPrismPVStatus())) 
		{
			result = false;
			setComment("Difference in PRISM PV Status  -   " + this.getPrismPVStatus() + " != " + layout.getPrismPVStatus());
		}
		
		return result;
	}
}
